So i am making a ticket system and i need a certain role to be able to look in the newly created channel but it keeps complaining i didn't supply a role even though i most definitely did.
I have tried the following:
await interaction.guild.roles.fetch()
let helperrol = await interaction.guild.roles.cache.find(role => role.id ===
rolesAndChannels.helperRol);
let modrol = await interaction.guild.roles.cache.find(role => role.id ===
rolesAndChannels.moderatorRol);
await interaction.guild.channels.create(kanaalmaaknaam, {
type: 'text',
parent: rolesAndChannels.ticketCatagorie,
permissionOverwrites: [{
id: interaction.guild.id,
deny: ['VIEW_CHANNEL', 'SEND_MESSAGES'],
},
{
id: interaction.user.id,
allow: ['VIEW_CHANNEL', 'SEND_MESSAGES'],
},
{
id: helperrol,
allow: ['VIEW_CHANNEL', 'SEND_MESSAGES'],
},
{
id: modrol,
allow: ['VIEW_CHANNEL', 'SEND_MESSAGES'],
},
],
}).catch('Er is een fout opgetreden bij het maken van het text kanaal');
But I still get the error.
I have tried:
{
id: rolesAndChannels.moderatorRol,
allow: ['VIEW_CHANNEL', 'SEND_MESSAGES'],
},
Where rolesAndChannels.moderatorRol is the roleID but that results in the same error.
I have also tried to just supply the roleID directly but still same error.
I have enabled the partials intent if that's important.
Its a slash command.
The awnser was that I somehow copied the wrong ID's of the roles or something. I recopied the role ID's from the settings menu and that fixed the error.